//
//  ViewController.m
//  MVCTest
//
//  Created by 王冲 on 2018/9/29.
//  Copyright © 2018年 JK科技有限公司. All rights reserved.
//

#import "ViewController.h"
#import "JKViewController.h"
#import "TestViewController.h"
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.title = @"MVC架构";
    self.view.backgroundColor = [UIColor whiteColor];
    
    UIButton *btn1 = [[UIButton alloc]initWithFrame:CGRectMake(20, [UIScreen mainScreen].bounds.size.height/2-100, [UIScreen mainScreen].bounds.size.width-40, 50)];
    [btn1 setTitle:@"传统的MVC" forState:UIControlStateNormal];
    [btn1 setBackgroundColor:[UIColor brownColor]];
    [btn1 addTarget:self action:@selector(click1) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn1];
    
    UIButton *btn2 = [[UIButton alloc]initWithFrame:CGRectMake(20, CGRectGetMaxY(btn1.frame)+20, [UIScreen mainScreen].bounds.size.width-40, 50)];
    [btn2 setTitle:@"变种的MVC" forState:UIControlStateNormal];
    [btn2 setBackgroundColor:[UIColor brownColor]];
    [btn2 addTarget:self action:@selector(click2) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn2];

}

#pragma mark 传统的MVC
-(void)click1{
    
    JKViewController *vc = [JKViewController new];
    [self.navigationController pushViewController:vc animated:YES];
    
}
#pragma mark 变种的MVC
-(void)click2{
    
    TestViewController *vc = [TestViewController new];
    [self.navigationController pushViewController:vc animated:YES];
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
